package aor2.cpu.blockinterface;

import aor2.components.Register;
import aor2.components.Signal;
import aor2.cpu.InternBus;

/**
 * MAR registar
 * 
 * @author Moxi
 * 
 */
final public class Mar extends Register {

	Signal mxMar;

	@Override
	public void in() {
		if (mxMar.isActive()) {
			super.setState(InternBus.M2.getState());
		} else
			super.setState(InternBus.M1.getState());
	}

	@Override
	public void out() {
		// ignore
	}

	Mar(Signal mxMar) {
		super();
		this.mxMar = mxMar;
	}

	@Override
	public String toString() {
		return "MAR: " + state;
	}

}
